package com.jwsoft.manager.core.gateway.controller.common;

import com.bifang.engine.assistant.core.domain.AppResponse;
import com.bifang.module.base.common.vo.dict.SelectVO;
import com.bifang.module.base.common.vo.system.TokenVO;
import com.jwsoft.manager.common.vo.common.XzjhAppVO;
import com.jwsoft.manager.common.vo.common.XzjhPCVO;
import com.jwsoft.manager.core.integration.common.XzjhLoginIntegration;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "学在金华登录", description = "学在金华登录")
public class XzjhLoginController {
    @Autowired
    XzjhLoginIntegration xzjhLoginIntegration;
    @PostMapping(value = "/xzjh0001")
    @Operation(summary = "学校金华PC端登录", description = "学校金华PC端登录")
    public AppResponse<TokenVO> loginPc(@RequestBody XzjhPCVO vo){

        return AppResponse.successData(xzjhLoginIntegration.loginPc(vo));
    }

    @PostMapping(value = "/xzjh0002")
    @Operation(summary = "学校金华手机端端登录", description = "学校金华手机端端登录")
    public AppResponse<TokenVO> loginApp(@RequestBody XzjhAppVO vo){

        return AppResponse.successData(xzjhLoginIntegration.loginApp(vo));
    }
    @PostMapping(value = "/xzjh0003")
    @Operation(summary = "获取可选择的学校", description = "获取可选择的学校")
    public AppResponse<List<SelectVO>> selectOrg(@RequestBody XzjhPCVO vo){

        return AppResponse.successData(xzjhLoginIntegration.selectOrg(vo));
    }
}
